package org.wattdepot.cli.command;

import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import org.wattdepot.cli.CommandLineInterface;

/**
 * Test that checks for valid output within the ListPowerGeneratedDayCommand class.
 * 
 * @author Anthony Xu & John Mack
 * 
 */

public class TestPowerstat {

  /**
   * Test to see if the powerstat displays correct output for max statistic.
   * 
   * @throws Exception NotAuthorizedException, ResourceNotFoundException, BadXmlException,
   * MiscClientException.
   */
  @Test
  public void testListSummary() throws Exception {
    CommandLineInterface cli = new CommandLineInterface();
    List<String> commands = new ArrayList<String>();
    commands.add("powerstat");
    commands.add("generated");
    commands.add("SIM_KAHE_2");
    commands.add("day");
    commands.add("2009-10-31");
    commands.add("sampling-interval");
    commands.add("60");
    commands.add("statistic");
    commands.add("max");

    String thePowerstat = new ListPowerGeneratedDayCommand().doCommand(cli, commands);
    assertEquals("correct max output", "Max Generated Power: 8.8E7", thePowerstat);

  }

}
